function [] = write(ko)
%WRITE Summary of this function goes here
%   Detailed explanation goes here

fid = fopen('KPOINTS', 'wt');
fprintf(fid, [ko.CommentLine, '\n']);
fprintf(fid, [num2str(ko.NumKPoints), ' \n']);
for i = 1:length(ko.CoordinatesType)
  fprintf(fid, [num2str(ko.CoordinatesType{i}), ' \n']);
end
for i = 1:size(ko.Grid, 1)
  fprintf(fid, [num2str(ko.Grid(i, :)), ' \n']);
  if mod(i, 2)==0
    fprintf(fid, '\n');
  end
end

%fprintf(fid, [num2str(ko.Shift), ' \n']);
fclose(fid);

end

